import { type ComponentConfigModel } from '/@/views/formDesigner/utils';
export default {
  component: () => import('./button.vue'),
  defaultSchema: {
    label: '按钮',
    type: 'button',
    field: 'input',
    icon: 'epic-icon-button-remove',
    input: false,
    componentProps: {},
  },
  config: {
    attribute: [
      {
        label: '控件字段',
        type: 'input',
        field: 'name',
        componentProps: {
          placeholder: '必填项',
          require: true,
        },
      },
      {
        label: '控件名称',
        type: 'input',
        field: 'title',
        componentProps: {
          placeholder: '必填项',
          require: true,
        },
      },
      {
        label: '标签名称',
        type: 'input',
        field: 'label',
        componentProps: {
          placeholder: '必填项',
          require: true,
        },
      },
      {
        label: '位置',
        type: 'select',
        field: 'align',
        componentProps: {
          placeholder: '按钮位置',
          defaultValue: 'left',
          options: [
            {
              label: '居左',
              value: 'left',
            },
            {
              label: '居中',
              value: 'center',
            },
            {
              label: '居右',
              value: 'right',
            },
          ],
        },
      },
      {
        label: '提示',
        type: 'textarea',
        field: 'tip',
      },
      // {
      //   label: '脚本',
      //   type: 'textarea',
      //   field: 'script',
      // },
      {
        label: '编辑',
        type: 'buttonBtn',
        field: 'btnProps',
        // componentProps: {
        //   onClick: (event) => {
        //     console.log('click', { event });
        //   },
        // },
      },
    ],
    event: [
      {
        type: 'click',
        describe: '点击按钮时',
      },
      {
        type: 'dblclick',
        describe: '双击按钮时',
      },
    ],
  },
} as ComponentConfigModel;
